using Bzstd.Utility;

namespace Bzstd.Entity;

public class GameInfo
{
	public uint ConsumerAppId { get; init; }
	public uint CreatorAppId { get; init; }
	public uint[] SearchAppIds { get; init; }

	public override string ToString()
	{
		return $"{nameof(ConsumerAppId)}: {ConsumerAppId}, {nameof(CreatorAppId)}: {CreatorAppId}, {nameof(SearchAppIds)}: {string.Join('|', SearchAppIds)}";
	}

	public static GameInfo CreateP2GameInfo()
	{
		uint consumerAppId, creatorAppId;
		uint[] searchAppIds;
		if (ConfigHelper.CommandLineArgs.Length > 1)
		{
			consumerAppId = 620;
			creatorAppId = 644;
			searchAppIds = [644];
		}
		else
		{
			consumerAppId = 620;
			creatorAppId = 620;
			searchAppIds = [620, 644];
		}
		return new GameInfo
		{
			ConsumerAppId = consumerAppId,
			CreatorAppId = creatorAppId,
			SearchAppIds = searchAppIds
		};
	}
}
